<!--
 * @name: 公共底部组件
 * @version: 1.1.1
 * @Author: 刘大可
 * @Date: 2022-02-11 17:50:12
 * @LastEditors: 刘大可
 * @LastEditTime: 2022-09-09 15:11:45
-->
<template>
   <view class="footer flex">
        <block v-for="(item,index) in tabBar" :key="index">
            <view class="item flex" :class="flg==item.text?'cur':''" @click="go(item)"
                :style="style"
            >
                <image
                    class="icon"
                    :src="flg==item.text?item.selectedIconPath:item.iconPath"
                    mode="scaleToFill"
                />
                {{item.text}}
            </view>
        </block>
   </view>
</template>
<script>
export default {
    data() {
        return {
            tabBar:[

				{
				    "pagePath": "/gc_school/pages/jifen/shop",
				    "iconPath": "/static/tabbar/home.png",
				    "selectedIconPath": "/static/tabbar/home_s.png",
				    "text": "商品"
				},
                
                // {
                //     "pagePath": "/gc_school/pages/order/index",
                //     "iconPath": "/static/tabbar/order.png",
                //     "selectedIconPath": "/static/tabbar/order_s.png",
                //     "text": "订单"
                // },
              
				{
				    "pagePath": "/gc_school/pages/jifen/my",
				    "iconPath": "/static/tabbar/my.png",
				    "selectedIconPath": "/static/tabbar/my_s.png",
				    "text": "个人中心"
				}
                // {
                //     pagePath:"/pages/tabBar/index/index",
                //     text:"首页",
                //     iconPath:"/static/icon/tabBar/icon1.png",
                //     selectedIconPath:"/static/icon/tabBar/icon1_active.png"
                // },
                // {
                //     pagePath:"/pages/tabBar/product/product",
                //     text:"产品",
                //     iconPath:"/static/icon/tabBar/icon2.png",
                //     selectedIconPath:"/static/icon/tabBar/icon2_active.png"
                // },
                // {
                //     pagePath:"/pages/tabBar/shopCar/shopCar",
                //     text:"购物车",
                //     iconPath:"/static/icon/tabBar/icon3.png",
                //     selectedIconPath:"/static/icon/tabBar/icon3_active.png"
                // },
                // {
                //     pagePath:"/pages/tabBar/me/me",
                //     text:"我的",
                //     iconPath:"/static/icon/tabBar/icon4.png",
                //     selectedIconPath:"/static/icon/tabBar/icon4_active.png"
                // }
            ],
            style:`
                width: 33%;
            `
        }
    },
    props:{
        flg:{
            type:String,
        },
        // sys: {
        //     type: object,
        // }
    },
    created() {
        // uni.hideTabBar({
        //     animation:true
        // })
       let  sys=uni.getStorageSync('sys')
       let articles_switch=sys.index_articles_switch
       console.log(sys);
// articles_switch=0
      
       console.log(articles_switch);
    },
    methods: {
        go(item){
            // // uni.switchTab({ url: item.pagePath })
            // uni.redirectTo({
            //      url: item.pagePath 
            // });
            // uni.redirectTo({ url: '/pages/' })
            uni.reLaunch({
                 url: item.pagePath 
            });
        }
    }
}
</script>
<style lang="scss">
    @import "./main.scss";
</style>